<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<!--列表-->
<table class="table mb-15 table-hover">
    <thead>
    <tr>
        <th>序号</th>

        <th>登录账号</th>
        <th>人员姓名</th>
        <th>电话</th>
        <th>邮箱</th>
        <th>部门</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${datalist.list}" var="user" varStatus="i">
        <tr class="cen">
            <td>${i.index+1}</td>

            <td>${user.loginname}</td>
            <td>${user.nickname}</td>
            <td>${user.mobile}</td>
            <td>${user.email}</td>
            <td>管理员</td>
            <td>${user.state ==1001?"可用":"禁用"}</td>
            <td>
                <c:if test="${user.state ==1001}">
                    <a title="详情" class="mr-5" onclick="changeStatus('${user.sysid}','${user.state}')">禁用</a>
                </c:if>
                <c:if test="${user.state ==1000}" >
                    <a title="详情" class="mr-5" onclick="changeStatus('${user.sysid}','${user.state}')">启用</a>
                </c:if>
                <a title="详情" class="mr-5">详情</a>
                <a title="修改" class="mr-5" onclick="addOrUpdateUser('${user.sysid}')">修改</a>
                <a title="角色" onclick="assignRole('${user.sysid}')">角色</a>
            </td>
        </tr>
    </c:forEach>

    </tbody>
</table>


<!--分页-->
<div class="panel panel-default">
    <div class="panel-bd">
        <div class="pagination">

        </div>
    </div>
</div>


<script type="text/javascript">
    /*
     分页
     * */
    $(".pagination").createPage({
        pageCount: '${datalist.pages}',
        current: '${datalist.pageNum}',
        dataTotal: '${datalist.total}',
        backFn: function (p) {
            go_page(p);
        }
    });
</script>